using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using egypt.Logic;
using egypt.Logic.Data;

namespace egypt.Web
{
    public partial class detial : System.Web.UI.Page
    {
        int newsID = 0;
        News n = null;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.Request.QueryString["nid"] != null)
            {
                int.TryParse(Page.Request.QueryString["nid"], out newsID);
            }

            if (!Page.IsPostBack && newsID > 0)
            {
                DataAdapter da = new DataAdapter(System.Configuration.ConfigurationManager.ConnectionStrings["egypt"].ConnectionString);
                n = da.GetNews(newsID);
                this.title.Text = n.Title;
                this.time.Text = n.Addtime.ToString("yyyy-MM-dd HH:mm:ss");
                this.content.Text = n.Content;
            }
        }
    }
}
